Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wmentor/endian
BigEndian and LittleEndian detector
https://github.com/wmentor/endian
big-endian bigendian bytes golang golang-library golang-package little-endian littleendian
Last synced: about 1 month ago
JSON representation
BigEndian and LittleEndian detector
- Host: GitHub
- URL: https://github.com/wmentor/endian
- Owner: wmentor
- License: mit
- Created: 2022-10-12T18:46:14.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-12T19:35:32.000Z (about 2 years ago)
- Last Synced: 2024-06-21T09:59:56.541Z (6 months ago)
- Topics: big-endian, bigendian, bytes, golang, golang-library, golang-package, little-endian, littleendian
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# endian
[![test](https://github.com/wmentor/endian/actions/workflows/ci.yml/badge.svg)](https://github.com/wmentor/endian/actions/workflows/ci.yml)
[![https://goreportcard.com/report/github.com/wmentor/endian](https://goreportcard.com/badge/github.com/wmentor/endian)](https://goreportcard.com/report/github.com/wmentor/endian)
[![https://pkg.go.dev/github.com/wmentor/endian](https://pkg.go.dev/badge/github.com/wmentor/endian.svg)](https://pkg.go.dev/github.com/wmentor/endian)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)Detect byte order library (BigEndian or LittleEndian)
# Get bytes order
```go
package mainimport (
"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.