Standard library / math/bits
bits.ReverseBytes32()
Reverses byte order within the word; useful for explicit byte-order conversion. Expected stdout: '4660\n'.
Formal Syntax & Structure
go syntaxgo
func ReverseBytes32(x uint32) uint32Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | uint32 | First input operand (or sole input if unary). |
Return Value
uint32
Reverses byte order within the word; useful for explicit byte-order conversion.
Working Example
Example Snippetgo
package main
import ( "fmt" "math/bits")
func main() { fmt.Println(bits.ReverseBytes32(bits.ReverseBytes32(0x1234)))}