aboutsummaryrefslogtreecommitdiffstats
path: root/bytes.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-01-11 05:44:53 +0800
committerobscuren <geffobscura@gmail.com>2014-01-11 05:44:53 +0800
commit8bbf879cb31e9cb28700773ed788421f9935ac36 (patch)
treeea2ab662a0577aa6238b084eda7ec9644ee35995 /bytes.go
parentf6fa4f88797030b8e83066cb262a68958953974e (diff)
downloaddexon-8bbf879cb31e9cb28700773ed788421f9935ac36.tar
dexon-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.gz
dexon-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.bz2
dexon-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.lz
dexon-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.xz
dexon-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.zst
dexon-8bbf879cb31e9cb28700773ed788421f9935ac36.zip
Moving the ethgo to individual packages
Diffstat (limited to 'bytes.go')
-rw-r--r--bytes.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/bytes.go b/bytes.go
deleted file mode 100644
index 6bf381343..000000000
--- a/bytes.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package main
-
-import (
- "bytes"
- "encoding/binary"
- "fmt"
-)
-
-func NumberToBytes(num uint64, bits int) []byte {
- buf := new(bytes.Buffer)
- err := binary.Write(buf, binary.BigEndian, num)
- if err != nil {
- fmt.Println("binary.Write failed:", err)
- }
-
- return buf.Bytes()[buf.Len()-(bits / 8):]
-}
-
-func BytesToNumber(b []byte) (number uint64) {
- buf := bytes.NewReader(b)
- err := binary.Read(buf, binary.LittleEndian, &number)
- if err != nil {
- fmt.Println("binary.Read failed:", err)
- }
-
- return
-}