github.com/tunabay/go-bitarray@v1.3.1/bitarray_sha1_example_test.go (about) 1 // Copyright (c) 2021 Hirotsuna Mizuno. All rights reserved. 2 // Use of this source code is governed by the MIT license that can be found in 3 // the LICENSE file. 4 5 package bitarray_test 6 7 import ( 8 "fmt" 9 10 "github.com/tunabay/go-bitarray" 11 ) 12 13 func ExampleBitArray_SHA1() { 14 ba1 := bitarray.MustParse("01") 15 ba2 := bitarray.MustParse("01001") 16 17 fmt.Printf("%x\n", ba1.SHA1()) 18 fmt.Printf("%x\n", ba2.SHA1()) 19 20 // Output: 21 // ec6b39952e1a3ec3ab3507185cf756181c84bbe2 22 // 3320540d1c28b96ddd03eee1b186a8f2ae883fbe 23 }