Beta

Mac address converter

Description:

Ethernet Format to Token-Ring Format converter

During data link phase in a computer network, mac address exchange is performed by sending mac addresses in binary format.

By default, most network mac exchanges are performed in their canonical 802 (IEEE) format.

Note: Canonical form means that the least significant bit in the MAC is the first bit that maps to binary data in memory - e.g: In a LAN, the least significant bit is set to the corresponding first bit of the initial byte part in the binary form of data to be transferred -

In token ring-based networks, when circulating mac addresses the bit ordering is reversed and every first bit of bytes in memory during transfer are set to the most significant (or leftmost memory bits).This causes a left-to-right bit transfer outlined in the example below:

            In memory,      12       34       56       78       9A       BC
            canonical:   00010010 00110100 01010110 01111000 10011010 10111100

            1st bit appearing on LAN (group address indicator)
            |
            On LAN:      01001000 00101100 01101010 00011110 01011001 00111101

            In memory,
            MSB format:  01001000 00101100 01101010 00011110 01011001 00111101
                            48       2C       6A       1E       59       3D

You are required to prepare the function revOrderMark that can convert a mac address from canonical-format to token-ring format and vice-versa. The output of the function should be a mac address in IEEE format. In a case where an error input is found, a mac of 00-00-00-00-00-00 should be returned.

Error input types are descibed below:

            Alphanum tokens:   "ijsj38j2j4920xjc93202"
            Numeric input:     "77553516586165"
            Non-mac addresses: "90-B3-IK-23-44-7C" Or "90-BB-7829-900-A7-09" 

Output sample shown below:

             11-22-33-44-55-66

 

Relevant websites:

Algorithms
Binary
Bits
Arrays

Stats:

CreatedFeb 16, 2019
PublishedFeb 17, 2019
Warriors Trained363
Total Skips179
Total Code Submissions155
Total Times Completed39
JavaScript Completions39
Total Stars5
% of votes with a positive feedback rating76% of 21
Total "Very Satisfied" Votes15
Total "Somewhat Satisfied" Votes2
Total "Not Satisfied" Votes4
Total Rank Assessments17
Average Assessed Rank
6 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • chkhc Avatar
Ad