This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // The original solution uses DataView | |
| // Here I'm using custom getUint86 and getUint16 functions to understand | |
| // how things work under the hood | |
| function getUint16(bytes, offset, littleEndian = false) { | |
| const value = bytes[offset] << 8 | bytes[offset + 1] | |
| if (littleEndian) { | |
| return reverseBytes(value) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | fun getUint16(bytes: List<Int>, offset: Int, littleEndian: Boolean): Int { | |
| val value = (bytes[offset] shl 8) or bytes[offset + 1] | |
| return if (littleEndian) value.reverseBytes() else value | |
| } | |
| fun getUint32(bytes: List<Int>, offset: Int, littleEndian: Boolean): Int { | |
| val value = (bytes[offset] shl 24) or (bytes[offset + 1] shl 16) or (bytes[offset + 2] shl 8) or bytes[offset + 3] | |
| return if (littleEndian) value.reverseBytes() else value | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # xcode-build-bump.sh | |
| # @desc Auto-increment the build number every time the project is run. | |
| # @usage | |
| # 1. Select: your Target in Xcode | |
| # 2. Select: Build Phases Tab | |
| # 3. Select: Add Build Phase -> Add Run Script | |
| # 4. Paste code below in to new "Run Script" section | |
| # 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
| # 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |