license import { TypedArray , util } from '@tensorflow/tfjs-core' ; export function stringToHashBucketFastImpl ( input , numBuckets ) { const output = util . getArrayFromDType ( 'int32' , input . length ) as TypedArray ; for ( let i = 0 ; i < input . length ; ++ i ) { output [ i ] = util . fingerPrint64 ( input [ i ] ) . modulo ( numBuckets ) . getLowBitsUnsigned ( ) ; } return output ; }