- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 16 for BinaryMarshaler (0.21 sec)
-
src/encoding/encoding.go
// the addition of marshaling functions if no existing, reasonable marshaling exists. package encoding // BinaryMarshaler is the interface implemented by an object that can // marshal itself into a binary form. // // MarshalBinary encodes the receiver into a binary form and returns the result. type BinaryMarshaler interface { MarshalBinary() (data []byte, err error) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 23 19:43:37 UTC 2023 - 2.2K bytes - Viewed (0) -
doc/next/6-stdlib/99-minor/crypto/x509/66249.md
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 16 15:53:51 UTC 2024 - 238 bytes - Viewed (0) -
test/typeparam/issue47713.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "encoding" "fmt" ) type Seralizable interface { encoding.BinaryMarshaler encoding.BinaryUnmarshaler } type SerDeString string func (s *SerDeString) UnmarshalBinary(in []byte) error { *s = SerDeString(in) return nil }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 19:45:34 UTC 2022 - 888 bytes - Viewed (0) -
src/crypto/hmac/hmac.go
// ipad = 0x36 byte repeated for key length // opad = 0x5c byte repeated for key length // hmac = H([key ^ opad] H([key ^ ipad] text)) // marshalable is the combination of encoding.BinaryMarshaler and // encoding.BinaryUnmarshaler. Their method definitions are repeated here to // avoid a dependency on the encoding package. type marshalable interface { MarshalBinary() ([]byte, error) UnmarshalBinary([]byte) error
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 17:09:47 UTC 2023 - 4.7K bytes - Viewed (0) -
src/hash/hash.go
package hash import "io" // Hash is the common interface implemented by all hash functions. // // Hash implementations in the standard library (e.g. [hash/crc32] and // [crypto/sha256]) implement the [encoding.BinaryMarshaler] and // [encoding.BinaryUnmarshaler] interfaces. Marshaling a hash implementation // allows its internal state to be saved and used for additional processing
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 19:15:34 UTC 2023 - 2.1K bytes - Viewed (0) -
src/math/rand/v2/chacha8.go
if len(b) == 0 || len(b) < int(1+b[0]) { return nil, nil, false } return b[1 : 1+b[0]], b[1+b[0]:], true } // MarshalBinary implements the encoding.BinaryMarshaler interface. func (c *ChaCha8) MarshalBinary() ([]byte, error) { if c.readLen > 0 { out := []byte("readbuf:") out = append(out, uint8(c.readLen)) out = append(out, c.readBuf[len(c.readBuf)-c.readLen:]...)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 22:09:08 UTC 2024 - 2.8K bytes - Viewed (0) -
src/hash/crc32/crc32.go
// polynomial represented by the [Table]. Its Sum method will lay the // value out in big-endian byte order. The returned Hash32 also // implements [encoding.BinaryMarshaler] and [encoding.BinaryUnmarshaler] to // marshal and unmarshal the internal state of the hash. func New(tab *Table) hash.Hash32 { if tab == IEEETable { ieeeOnce.Do(ieeeInit) } return &digest{0, tab} }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun May 12 05:36:29 UTC 2024 - 7.5K bytes - Viewed (0) -
src/hash/adler32/adler32.go
func (d *digest) Reset() { *d = 1 } // New returns a new hash.Hash32 computing the Adler-32 checksum. Its // Sum method will lay the value out in big-endian byte order. The // returned Hash32 also implements [encoding.BinaryMarshaler] and // [encoding.BinaryUnmarshaler] to marshal and unmarshal the internal // state of the hash. func New() hash.Hash32 { d := new(digest) d.Reset() return d }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun May 12 05:36:29 UTC 2024 - 3K bytes - Viewed (0) -
src/math/rand/v2/pcg.go
} // Seed resets the PCG to behave the same way as NewPCG(seed1, seed2). func (p *PCG) Seed(seed1, seed2 uint64) { p.hi = seed1 p.lo = seed2 } // MarshalBinary implements the encoding.BinaryMarshaler interface. func (p *PCG) MarshalBinary() ([]byte, error) { b := make([]byte, 20) copy(b, "pcg:") byteorder.BePutUint64(b[4:], p.hi) byteorder.BePutUint64(b[4+8:], p.lo) return b, nil }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 13 21:31:58 UTC 2024 - 2.9K bytes - Viewed (0) -
src/crypto/md5/md5.go
} func consumeUint32(b []byte) ([]byte, uint32) { return b[4:], byteorder.BeUint32(b[0:4]) } // New returns a new hash.Hash computing the MD5 checksum. The Hash also // implements [encoding.BinaryMarshaler] and [encoding.BinaryUnmarshaler] to // marshal and unmarshal the internal state of the hash. func New() hash.Hash { d := new(digest) d.Reset() return d }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 13 18:57:38 UTC 2024 - 4.3K bytes - Viewed (0)