Equals
Overview
Equals reports whether a and b are equal (timing-safe enough for content equality).
If you are coming from Node.js, the closest pattern is buf.equals(other).
Signature
go
func Equals(a, b Buffer) boolCompare: Node.js · Standard Go · gox
js
buf.equals(other)go
ok := bytes.Equal(a, b)go
import "github.com/sahilkhaire/gox/buffer"
buffer.Equals(a, b)Example
go
import "github.com/sahilkhaire/gox/buffer"
buffer.Equals(a, b)Tips
Import github.com/sahilkhaire/gox/buffer and call Equals directly. See the comparison below for the standard library equivalent.
Standard library alternative
Use the standard library directly:
go
ok := bytes.Equal(a, b)