Skip to content

Instantly share code, notes, and snippets.

@IAFahim
Created January 28, 2022 17:10
Show Gist options
  • Save IAFahim/5b4fd3803a609ed59164dba9f50699f4 to your computer and use it in GitHub Desktop.
Save IAFahim/5b4fd3803a609ed59164dba9f50699f4 to your computer and use it in GitHub Desktop.
reverse byte form a-b
func reverse(arr []byte, start, end int) {
for i, j := start, end-1; i < end/2; i, j = i+1, j-1 {
arr[i], arr[j] = arr[j], arr[i]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment