5 kyu
Endianness Conversion
158 of 215psytech140
Loading description...
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Pretty funny kata, congratulations.
Prolog translation
"The bit size must be a power of 2 greater than or equal to 8." is not currently being tested, and there are some answers that just require it to be a multiple of 8.
Python fork that fixes that issue (not testing negative input).
Approved
Missing random tests in Ruby.
This isn't currently being tested in python or ruby.
TypeScript translation
explain it to me like I'm a five year old.
Endianness is a way of storing numbers in memory. There are two ways to do this, called big-endian and little-endian. In big-endian, the most significant byte is stored first, and in little-endian, the least significant byte is stored first.
Here's an example: let's say we have the number 12345. In big-endian, this would be stored as 0x05040302, because the most significant byte is 0x05. In little-endian, it would be stored as 0x02030405, because the least significant byte is 0x02.
Endianness can be important when you're working with data that's been stored in a file or transmitted over a network. If you don't know the endianness of the data, you could end up interpreting it incorrectly.
Here's a simple way to remember the difference between big-endian and little-endian: big-endian is like a big person, who puts their biggest shoe on first. Little-endian is like a little person, who puts their littlest shoe on first.
(Brought to you by PaLM 2)
JS, Crystal and c++ versions available :)
JS approved
Make it Python3 compatible.
Done
No random tests
Python fork
Approved.