diff options
Diffstat (limited to 'src/index.go')
-rw-r--r-- | src/index.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/index.go b/src/index.go index e518b0f..1ba040e 100644 --- a/src/index.go +++ b/src/index.go @@ -2,8 +2,8 @@ package main import ( "crypto/rand" + "encoding/binary" "sync" - "unsafe" ) /* Index=0 is reserved for unset indecies @@ -24,7 +24,8 @@ type IndexTable struct { func randUint32() (uint32, error) { var buff [4]byte _, err := rand.Read(buff[:]) - return *((*uint32)(unsafe.Pointer(&buff))), err + value := binary.LittleEndian.Uint32(buff[:]) + return value, err } func (table *IndexTable) Init() { |