Moved bson to separate package
This commit is contained in:
7 files changed
+646
-262
No files matched your search
@@ -0,0 +1,25 @@
|
||||
package bson2
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
func fromHex(hex string) (*big.Int, error) {
|
||||
n, err := new(big.Int).SetString(hex, 16)
|
||||
if !err {
|
||||
msg := fmt.Sprintf("Cannot convert %s to int as hexadecimal", hex)
|
||||
return nil, errors.New(msg)
|
||||
}
|
||||
return n, nil
|
||||
}
|
||||
|
||||
func all(oks []bool) bool {
|
||||
for _, ok := range oks {
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
Reference in new issue
Block a user