Moved bson to separate package

This commit is contained in:
Jakub Nowakowski committed 2018-06-11 19:15:21 +02:00
1 parent 581517debf
commit c0e04321bb
7 files changed
+646 -262

No files matched your search

+25
View File
@@ -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
}