decoder_le.go 617 B

1234567891011121314151617181920
  1. //go:build 386 || amd64 || amd64p32 || arm || arm64 || mipsle || mips64le || mips64p32le || ppc64le || riscv || riscv64 || wasm
  2. // +build 386 amd64 amd64p32 arm arm64 mipsle mips64le mips64p32le ppc64le riscv riscv64 wasm
  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[0]
  9. *(*byte)(unsafe.Pointer(ptr + 1)) = tail[1]
  10. *(*byte)(unsafe.Pointer(ptr + 2)) = tail[2]
  11. case 2:
  12. *(*byte)(unsafe.Pointer(ptr)) = tail[0]
  13. *(*byte)(unsafe.Pointer(ptr + 1)) = tail[1]
  14. case 1:
  15. *(*byte)(unsafe.Pointer(ptr)) = tail[0]
  16. }
  17. }