Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- </head>
- <body>
- <script>
- function dictionary(tab){
- var novbroj= 0;
- dict = Object ();
- var vrednost = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];
- var kluc = [0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F'];
- for(i=0; i<vrednost.length; i++){
- dict.insert(kluc[i],vrednost[i]);
- }
- var broj = 0;
- for(i=0, tab[i]!=-1; i++){
- broj++;
- }
- for(i=0;tab[i]!=-1; i++){
- novbroj = novbroj + dict.lookup(tab[i])*Math.pow(16,broj-1);
- broj--;
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement