Skip to content

Instantly share code, notes, and snippets.

@jdkanani
Created February 10, 2020 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdkanani/1ee97b7657408187ddfdc2b7d7ea4acc to your computer and use it in GitHub Desktop.
Save jdkanani/1ee97b7657408187ddfdc2b7d7ea4acc to your computer and use it in GitHub Desktop.
package main
import (
"encoding/hex"
"fmt"
"github.com/maticnetwork/heimdall/bor"
"github.com/maticnetwork/heimdall/helper"
)
func makeRange(min, max int) []uint64 {
a := make([]uint64, max-min+1)
for i := range a {
a[i] = uint64(min + i)
}
return a
}
func main() {
seed, _ := hex.DecodeString("")
result, err := bor.ShuffleList(makeRange(1, 116), helper.ToBytes32(seed))
if err != nil {
fmt.Println(err)
return
}
fmt.Println(result[:20])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment