Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 39 for BinaryMarshaler (0.22 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. src/hash/fnv/fnv_test.go

    		t.Run(tt.name, func(t *testing.T) {
    			for _, g := range tt.gold {
    				h := tt.newHash()
    				h2 := tt.newHash()
    
    				io.WriteString(h, g.in[:len(g.in)/2])
    
    				state, err := h.(encoding.BinaryMarshaler).MarshalBinary()
    				if err != nil {
    					t.Errorf("could not marshal: %v", err)
    					continue
    				}
    
    				if string(state) != g.halfState {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 01 21:04:12 UTC 2017
    - 7.3K 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/debug.go

    	case 4: // GobEncoder type, one field of {{Common}}
    		// Field number 0 is CommonType
    		deb.delta(1)
    		com := deb.common()
    		wire.GobEncoderT = &gobEncoderType{com}
    	case 5: // BinaryMarshaler type, one field of {{Common}}
    		// Field number 0 is CommonType
    		deb.delta(1)
    		com := deb.common()
    		wire.BinaryMarshalerT = &gobEncoderType{com}
    	case 6: // TextMarshaler type, one field of {{Common}}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 20 09:34:41 UTC 2023
    - 18.3K bytes
    - Viewed (0)
  10. 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)
Back to top