Add a note.
This commit is contained in:
parent
26dcb6035a
commit
2796f1b209
|
@ -38,6 +38,8 @@ test() ->
|
||||||
<<246, 54, 54, 166, 22>> = reverse_bits(<<"hello">>).
|
<<246, 54, 54, 166, 22>> = reverse_bits(<<"hello">>).
|
||||||
|
|
||||||
%% 5. Write a function to reverse the bits in a binary.
|
%% 5. Write a function to reverse the bits in a binary.
|
||||||
|
|
||||||
|
%% This feels pretty inelegant.
|
||||||
reverse_byte(<<A:1, B:1, C:1, D:1, E:1, F:1, G:1, H:1>>) ->
|
reverse_byte(<<A:1, B:1, C:1, D:1, E:1, F:1, G:1, H:1>>) ->
|
||||||
<<H:1,G:1,F:1,E:1,D:1,C:1,B:1,A:1>>;
|
<<H:1,G:1,F:1,E:1,D:1,C:1,B:1,A:1>>;
|
||||||
reverse_byte(<<>>) -> <<>>.
|
reverse_byte(<<>>) -> <<>>.
|
||||||
|
|
Loading…
Reference in New Issue