MCPcopy Create free account
hub / github.com/cockroachdb/apd / checkSetBytes

Function checkSetBytes

bigint_test.go:1244–1257  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

1242}
1243
1244func checkSetBytes(b []byte) bool {
1245 hex1 := hex.EncodeToString(new(BigInt).SetBytes(b).Bytes())
1246 hex2 := hex.EncodeToString(b)
1247
1248 for len(hex1) < len(hex2) {
1249 hex1 = "0" + hex1
1250 }
1251
1252 for len(hex1) > len(hex2) {
1253 hex2 = "0" + hex2
1254 }
1255
1256 return hex1 == hex2
1257}
1258
1259func TestBigIntSetBytes(t *testing.T) {
1260 if err := quick.Check(checkSetBytes, nil); err != nil {

Callers

nothing calls this directly

Calls 2

BytesMethod · 0.80
SetBytesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…