github.com/moontrade/nogc@v0.1.7/hash/hash.go (about)

     1  package hash
     2  
     3  func toUint16LE(b []byte) uint16 {
     4  	return uint16(b[0]) | uint16(b[1])<<8
     5  }
     6  
     7  func toUint32LE(b []byte) uint32 {
     8  	return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
     9  }
    10  
    11  func toUint64LE(b []byte) uint64 {
    12  	return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 |
    13  		uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
    14  }