decoder_be.go 588 B

1234567891011121314151617181920
  1. //go:build armbe || arm64be || mips || mips64 || mips64p32 || ppc || ppc64 || sparc || sparc64 || s390 || s390x
  2. // +build armbe arm64be mips mips64 mips64p32 ppc ppc64 sparc sparc64 s390 s390x
  3. package yu_base64
  4. import "unsafe"
  5. func putTail(ptr uintptr, tail *[4]byte, n int) {
  6. switch n {
  7. case 3:
  8. *(*byte)(unsafe.Pointer(ptr)) = tail[3]
  9. *(*byte)(unsafe.Pointer(ptr + 1)) = tail[2]
  10. *(*byte)(unsafe.Pointer(ptr + 2)) = tail[1]
  11. case 2:
  12. *(*byte)(unsafe.Pointer(ptr)) = tail[3]
  13. *(*byte)(unsafe.Pointer(ptr + 1)) = tail[2]
  14. case 1:
  15. *(*byte)(unsafe.Pointer(ptr)) = tail[3]
  16. }
  17. }