Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 22 for BinaryMarshaler (0.32 sec)

  1. src/crypto/sha1/sha1.go

    	d.h[1] = init1
    	d.h[2] = init2
    	d.h[3] = init3
    	d.h[4] = init4
    	d.nx = 0
    	d.len = 0
    }
    
    // New returns a new hash.Hash computing the SHA1 checksum. The Hash also
    // implements [encoding.BinaryMarshaler] and [encoding.BinaryUnmarshaler] to
    // marshal and unmarshal the internal state of the hash.
    func New() hash.Hash {
    	if boring.Enabled {
    		return boring.NewSHA1()
    	}
    	d := new(digest)
    	d.Reset()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:50:58 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  2. src/go/internal/gcimporter/gcimporter_test.go

    	{"crypto.Decrypter", "type Decrypter interface{Decrypt(rand io.Reader, msg []byte, opts DecrypterOpts) (plaintext []byte, err error); Public() PublicKey}"},
    	{"encoding.BinaryMarshaler", "type BinaryMarshaler interface{MarshalBinary() (data []byte, err error)}"},
    	{"io.Reader", "type Reader interface{Read(p []byte) (n int, err error)}"},
    	{"io.ReadWriter", "type ReadWriter interface{Reader; Writer}"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 16:22:59 UTC 2024
    - 21.9K bytes
    - Viewed (0)
  3. src/crypto/sha256/sha256.go

    		d.h[5] = init5_224
    		d.h[6] = init6_224
    		d.h[7] = init7_224
    	}
    	d.nx = 0
    	d.len = 0
    }
    
    // New returns a new hash.Hash computing the SHA256 checksum. The Hash
    // also implements [encoding.BinaryMarshaler] and
    // [encoding.BinaryUnmarshaler] to marshal and unmarshal the internal
    // state of the hash.
    func New() hash.Hash {
    	if boring.Enabled {
    		return boring.NewSHA256()
    	}
    	d := new(digest)
    	d.Reset()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:50:58 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  4. src/crypto/x509/oid.go

    		if !ok {
    			return errInvalidOID
    		}
    		der = appendBase128BigInt(der, b)
    	}
    
    	o.der = der
    	return nil
    }
    
    // MarshalBinary implements [encoding.BinaryMarshaler]
    func (o OID) MarshalBinary() ([]byte, error) {
    	return bytes.Clone(o.der), nil
    }
    
    // UnmarshalBinary implements [encoding.BinaryUnmarshaler]
    func (o *OID) UnmarshalBinary(b []byte) error {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 19:10:38 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  5. src/crypto/x509/oid_test.go

    	}
    
    	for _, tt := range cases {
    		if eq := tt.oid.Equal(tt.oid2); eq != tt.eq {
    			t.Errorf("(%v).Equal(%v) = %v, want %v", tt.oid, tt.oid2, eq, tt.eq)
    		}
    	}
    }
    
    var (
    	_ encoding.BinaryMarshaler   = OID{}
    	_ encoding.BinaryUnmarshaler = new(OID)
    	_ encoding.TextMarshaler     = OID{}
    	_ encoding.TextUnmarshaler   = new(OID)
    )
    
    func TestOIDMarshal(t *testing.T) {
    	cases := []struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 19:10:38 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  6. src/crypto/sha512/sha512.go

    // Package sha512 implements the SHA-384, SHA-512, SHA-512/224, and SHA-512/256
    // hash algorithms as defined in FIPS 180-4.
    //
    // All the hash.Hash implementations returned by this package also
    // implement encoding.BinaryMarshaler and encoding.BinaryUnmarshaler to
    // marshal and unmarshal the internal state of the hash.
    package sha512
    
    import (
    	"crypto"
    	"crypto/internal/boring"
    	"errors"
    	"hash"
    	"internal/byteorder"
    )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:50:58 UTC 2024
    - 9.2K bytes
    - Viewed (0)
  7. src/encoding/gob/type.go

    	decIndir    int8         // number of indirections to reach the receiver type; may be negative
    }
    
    // externalEncoding bits
    const (
    	xGob    = 1 + iota // GobEncoder or GobDecoder
    	xBinary            // encoding.BinaryMarshaler or encoding.BinaryUnmarshaler
    	xText              // encoding.TextMarshaler or encoding.TextUnmarshaler
    )
    
    var userTypeCache sync.Map // map[reflect.Type]*userTypeInfo
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 02:00:26 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  8. src/net/netip/netip.go

    		byteorder.BePutUint64(b[:8], ip.addr.hi)
    		byteorder.BePutUint64(b[8:], ip.addr.lo)
    		copy(b[16:], z)
    	}
    	return b
    }
    
    // MarshalBinary implements the [encoding.BinaryMarshaler] interface.
    // It returns a zero-length slice for the zero [Addr],
    // the 4-byte form for an IPv4 address,
    // and the 16-byte form with zone appended for an IPv6 address.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 17:10:01 UTC 2024
    - 43.2K bytes
    - Viewed (0)
  9. src/encoding/gob/encode.go

    	var data []byte
    	var err error
    	// We know it's one of these.
    	switch ut.externalEnc {
    	case xGob:
    		data, err = v.Interface().(GobEncoder).GobEncode()
    	case xBinary:
    		data, err = v.Interface().(encoding.BinaryMarshaler).MarshalBinary()
    	case xText:
    		data, err = v.Interface().(encoding.TextMarshaler).MarshalText()
    	}
    	if err != nil {
    		error_(err)
    	}
    	state := enc.newEncoderState(b)
    	state.fieldnum = -1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 02:00:26 UTC 2024
    - 19K bytes
    - Viewed (0)
  10. src/encoding/gob/doc.go

    at the top level will fail. A struct field of chan or func type is treated exactly
    like an unexported field and is ignored.
    
    Gob can encode a value of any type implementing the [GobEncoder] or
    [encoding.BinaryMarshaler] interfaces by calling the corresponding method,
    in that order of preference.
    
    Gob can decode a value of any type implementing the [GobDecoder] or
    [encoding.BinaryUnmarshaler] interfaces by calling the corresponding method,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 20:22:45 UTC 2024
    - 17.1K bytes
    - Viewed (0)
Back to top