Skip to content

wmentor/endian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

endian

test https://goreportcard.com/report/github.com/wmentor/endian https://pkg.go.dev/github.com/wmentor/endian License: MIT

Detect byte order library (BigEndian or LittleEndian)

Get bytes order

package main

import (
    "fmt"

    "github.com/wmentor/endian"
)

func main() {
    order := endian.GetOrder()

    if order == endian.BigEndian {
        fmt.Println("Big Endian")
    } else {
        fmt.Println("Little Endian")
    }
}

Insted of endian.BigEndian you can use endian.LittleEndian constant.