hotp.go
func truncate(in []byte) int64 {
	offset := int(in[len(in)-1] & 0xF)
	p := in[offset : offset+4]
	var binCode int32
	binCode = int32((p[0] & 0x7f)) << 24
	binCode += int32((p[1] & 0xff)) << 16
	binCode += int32((p[2] & 0xff)) << 8
	binCode += int32((p[3] & 0xff))
	return int64(binCode) & 0x7FFFFFFF
}
func truncate(in []byte) int64 {
	offset := int(in[len(in)-1] & 0xF)
	p := in[offset : offset+4]
	var binCode int32
	binCode = int32((p[0] & 0x7f)) << 24
	binCode += int32((p[1] & 0xff)) << 16
	binCode += int32((p[2] & 0xff)) << 8
	binCode += int32((p[3] & 0xff))
	return int64(binCode) & 0x7FFFFFFF
}
func truncate ( in [ ] byte ) int64 { offset := int ( in [ len ( in ) - 1 ] & 0xF ) p := in [ offset : offset + 4 ] var binCode int32 binCode = int32 ( ( p [ 0 ] & 0x7f ) ) << 24 binCode += int32 ( ( p [ 1 ] & 0xff ) ) << 16 binCode += int32 ( ( p [ 2 ] & 0xff ) ) << 8 binCode += int32 ( ( p [ 3 ] & 0xff ) ) return int64 ( binCode ) & 0x7FFFFFFF }
// truncate contains the DT function from the RFC; this is used to
// deterministically select a sequence of 4 bytes from the HMAC
// counter hash.
truncate contains the DT function from the RFC ; this is used to deterministically select a sequence of 4 bytes from the HMAC counter hash .