Skip to content

Commit

Permalink
pkg/private/common: remove NativeOrder and IsBigEndian
Browse files Browse the repository at this point in the history
No longer needed.
Native byte order is not often needed, but will eventually show up in
standard library anyway (golang/go#57237).
  • Loading branch information
matzf committed Feb 3, 2023
1 parent c9609c3 commit 346e06d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 38 deletions.
1 change: 0 additions & 1 deletion pkg/private/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ load("//tools/lint:go.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = [
"binary.go",
"defs.go",
"errors.go",
],
Expand Down
36 changes: 0 additions & 36 deletions pkg/private/common/binary.go

This file was deleted.

3 changes: 2 additions & 1 deletion pkg/scrypto/rand.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package scrypto

import (
"crypto/rand"
"encoding/binary"
mrand "math/rand"

"github.com/scionproto/scion/pkg/private/common"
Expand All @@ -38,7 +39,7 @@ func RandUint64() uint64 {
// OS, and there's nothing we can do about it.
panic("No random numbers available")
}
return common.NativeOrder.Uint64(b)
return binary.LittleEndian.Uint64(b)
}

// RandInt64 returns a random int64 value. The returned value can be negative.
Expand Down

0 comments on commit 346e06d

Please sign in to comment.