|
1 | 1 |
|
| 2 | +// This base64 implementation is heavily inspired by: |
| 3 | + |
2 | 4 | // https://github.com/lemire/fastbase64/blob/master/src/chromiumbase64.c
|
| 5 | +/* |
| 6 | + Copyright (c) 2015-2016, Wojciech Muła, Alfred Klomp, Daniel Lemire |
| 7 | + (Unless otherwise stated in the source code) |
| 8 | + All rights reserved. |
| 9 | + |
| 10 | + Redistribution and use in source and binary forms, with or without |
| 11 | + modification, are permitted provided that the following conditions are |
| 12 | + met: |
| 13 | + |
| 14 | + 1. Redistributions of source code must retain the above copyright |
| 15 | + notice, this list of conditions and the following disclaimer. |
| 16 | + |
| 17 | + 2. Redistributions in binary form must reproduce the above copyright |
| 18 | + notice, this list of conditions and the following disclaimer in the |
| 19 | + documentation and/or other materials provided with the distribution. |
| 20 | + |
| 21 | + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS |
| 22 | + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
| 23 | + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
| 24 | + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 25 | + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 26 | + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
| 27 | + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 28 | + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 29 | + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 30 | + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 31 | + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 | + */ |
| 33 | + |
| 34 | +// https://github.com/client9/stringencoders/blob/master/src/modp_b64.c |
| 35 | +/* |
| 36 | + The MIT License (MIT) |
| 37 | + |
| 38 | + Copyright (c) 2016 Nick Galbreath |
| 39 | + |
| 40 | + Permission is hereby granted, free of charge, to any person obtaining a copy |
| 41 | + of this software and associated documentation files (the "Software"), to deal |
| 42 | + in the Software without restriction, including without limitation the rights |
| 43 | + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 44 | + copies of the Software, and to permit persons to whom the Software is |
| 45 | + furnished to do so, subject to the following conditions: |
| 46 | + |
| 47 | + The above copyright notice and this permission notice shall be included in all |
| 48 | + copies or substantial portions of the Software. |
| 49 | + |
| 50 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 51 | + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 52 | + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 53 | + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 54 | + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 55 | + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 56 | + SOFTWARE. |
| 57 | + */ |
3 | 58 |
|
4 | 59 | // MARK: - Encoding -
|
5 | 60 |
|
|
0 commit comments