Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # base64 [![Build status](https://travis-ci.org/mathiasbynens/base64.svg?branch=master)](https://travis-ci.org/mathiasbynens/base64) [![Dependency status](https://gemnasium.com/mathiasbynens/base64.svg)](https://gemnasium.com/mathiasbynens/base64)
  2. _base64_ is a robust base64 encoder/decoder that is fully compatible with [`atob()` and `btoa()`](http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#atob), written in JavaScript. The base64-encoding and -decoding algorithms it uses are fully [RFC 4648](http://tools.ietf.org/html/rfc4648#section-4) compliant.
  3. ## Installation
  4. Via [npm](http://npmjs.org/):
  5. ```bash
  6. npm install base-64
  7. ```
  8. Via [Bower](http://bower.io/):
  9. ```bash
  10. bower install base-64
  11. ```
  12. Via [Component](https://github.com/component/component):
  13. ```bash
  14. component install mathiasbynens/base64
  15. ```
  16. In a browser:
  17. ```html
  18. <script src="base64.js"></script>
  19. ```
  20. In [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):
  21. ```js
  22. var base64 = require('base-64');
  23. ```
  24. In [Rhino](http://www.mozilla.org/rhino/):
  25. ```js
  26. load('base64.js');
  27. ```
  28. Using an AMD loader like [RequireJS](http://requirejs.org/):
  29. ```js
  30. require(
  31. {
  32. 'paths': {
  33. 'base64': 'path/to/base64'
  34. }
  35. },
  36. ['base64'],
  37. function(base64) {
  38. console.log(base64);
  39. }
  40. );
  41. ```
  42. ## API
  43. ### `base64.version`
  44. A string representing the semantic version number.
  45. ### `base64.encode(input)`
  46. This function takes a byte string (the `input` parameter) and encodes it according to base64. The input data must be in the form of a string containing only characters in the range from U+0000 to U+00FF, each representing a binary byte with values `0x00` to `0xFF`. The `base64.encode()` function is designed to be fully compatible with [`btoa()` as described in the HTML Standard](http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#dom-windowbase64-btoa).
  47. ```js
  48. var encodedData = base64.encode(input);
  49. ```
  50. To base64-encode any Unicode string, [encode it as UTF-8 first](https://github.com/mathiasbynens/utf8.js#utf8encodestring):
  51. ```js
  52. var base64 = require('base-64');
  53. var utf8 = require('utf8');
  54. var text = 'foo © bar 𝌆 baz';
  55. var bytes = utf8.encode(text);
  56. var encoded = base64.encode(bytes);
  57. console.log(encoded);
  58. // → 'Zm9vIMKpIGJhciDwnYyGIGJheg=='
  59. ```
  60. ### `base64.decode(input)`
  61. This function takes a base64-encoded string (the `input` parameter) and decodes it. The return value is in the form of a string containing only characters in the range from U+0000 to U+00FF, each representing a binary byte with values `0x00` to `0xFF`. The `base64.decode()` function is designed to be fully compatible with [`atob()` as described in the HTML Standard](http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#dom-windowbase64-atob).
  62. ```js
  63. var decodedData = base64.decode(encodedData);
  64. ```
  65. To base64-decode UTF-8-encoded data back into a Unicode string, [UTF-8-decode it](https://github.com/mathiasbynens/utf8.js#utf8decodebytestring) after base64-decoding it:
  66. ```js
  67. var encoded = 'Zm9vIMKpIGJhciDwnYyGIGJheg==';
  68. var bytes = base64.decode(encoded);
  69. var text = utf8.decode(bytes);
  70. console.log(text);
  71. // → 'foo © bar 𝌆 baz'
  72. ```
  73. ## Support
  74. _base64_ is designed to work in at least Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, Rhino 1.7RC4, as well as old and modern versions of Chrome, Firefox, Safari, Opera, and Internet Explorer.
  75. ## Unit tests & code coverage
  76. After cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.
  77. Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.
  78. To generate the code coverage report, use `grunt cover`.
  79. ## Author
  80. | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
  81. |---|
  82. | [Mathias Bynens](http://mathiasbynens.be/) |
  83. ## License
  84. _base64_ is available under the [MIT](http://mths.be/mit) license.