Giter Site home page Giter Site logo

angular-md5's Introduction

angular-md5 Build Status

md5 for Angular.js and Gravatar filter

#How do I add this to my project?

You can download angular-md5 by:

<body ng-app="YOUR_APP" ng-controller="MainCtrl">
  <img src="http://www.gravatar.com/avatar/{{ email | gravatar }}">
  <input type="email" ng-model="email" placeholder="Email Address">
  {{ message }}
</body>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.js"></script>
<script src="app/bower_components/angular-md5/angular-md5.js"></script>
<script>
  angular.module('YOUR_APP', [
    'angular-md5', // you may also use 'ngMd5' or 'gdi2290.md5'
    'controllers'
  ]);
  angular.module('controllers', [])
    .controller('MainCtrl', ['$scope', 'md5', function($scope, md5) {

      $scope.$watch('email' ,function() {
        $scope.message = 'Your email Hash is: ' + md5.createHash($scope.email || '');
      });

    }]);
</script>

MIT

angular-md5's People

Contributors

benoror avatar patrickjs avatar rquadling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-md5's Issues

Filters have to be included separately to make them work.

It's not enough to add 'ngMd5' to dependencies you have also to add 'gdi2290.gravatar-filter' and 'gdi2290.md5-filter' if you want to use them.

It can be fixed by updating module declaration:

angular.module("angular-md5", [ "gdi2290.md5", "gdi2290.md5-filter", "gdi2290.gravatar-filter" ]);
angular.module("ngMd5", [ "gdi2290.md5", "gdi2290.md5-filter", "gdi2290.gravatar-filter" ]);

EDIT:

I've seen that the latest code has this dependencies added but distribution files are not updated with it. Anyway, I have tried to build the latest code and it still does not work...

Crash when generating hashes for single-digit numbers

This code will throw some js errors:

var currentId = 1;

FormIDProvider.getCurrentId = function (raw)
{
    if (raw)
    {
        return currentId;
    }

    return 'form-field-' + md5.createHash(currentId);
};

The console says:

RangeError: Invalid array length
   at convertToWordArray (/assets/js/angular/angular-md5.js:88:28)
    at Object.md5.createHash (/assets/js/angular/angular-md5.js:114:13)

As a workaround, this will help:

return 'form-field-' + md5.createHash('seed' + currentId);

Support Webpack + CommonJS Package Manager

Hi Patrick!

I am learning Webpack + ES6 and in the process porting my app (main ideas taken from here, also here and @kentcdodds's egghead screencasts).

This package is a dependency of my project. Basically I want to be able to implement the following ES6 code:

import './login.css';

import angular from 'angular';
import uirouter from 'angular-ui-router';
import md5 from 'angular-md5'; /** this **/

import routing from './login.routes';
import LoginCtrl from './login.controller';

export default angular.module('app.main.login', [
        uirouter,
        md5
    ])
  .config(routing)
  .controller('LoginCtrl', LoginCtrl)
  .name;

I've tried using the following code to support it:

if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){
  module.exports = 'angular-md5';
}

*Source: ui-router release

Actually I updated another old dependency this same way, and worked fine: benoror/angular-urlify@affc74b

I tried the same with angular-md5: https://github.com/benoror/angular-md5/blob/master/lib/index.js#L2

But for some reason webpack compiles it wrong, and throws the following error:

md5

I can make a PR to support it, I just need some advice.

Thanks in advance. Cheers!

Generating wrong hash with iOS10

I've an ionic app and I'm using this module to generate unique token to communicate with server. It is working for iOS 9< but not working with iOS 10.

Not sure the reason but this behavior could be seen easily with iOS10.

HMAC MD5?

Can support HMAC MD5 in the future?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.