UNPKG
reign
Version:
latest (0.0.1)
0.0.1
A persistent, typed-objects implementation.
github.com/codemix/reign
codemix/reign
reign
/
src
/
hash-functions
/
float32
/
index.js
10 lines
(8 loc)
•
257 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
/* @flow */
const
buffer =
new
ArrayBuffer
(
4
);
const
uint32Array =
new
Uint32Array
(buffer);
const
float32Array =
new
Float32Array
(buffer);
export
default
function
hashFloat32
(
input: float32
): uint32 { float32Array[
0
] = input;
return
uint32Array[
0
]; }