X-Received: by 10.182.246.7 with SMTP id xs7mr1250267obc.15.1403635533221; Tue, 24 Jun 2014 11:45:33 -0700 (PDT) X-Received: by 10.140.47.235 with SMTP id m98mr26670qga.37.1403635533196; Tue, 24 Jun 2014 11:45:33 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!uq10no7841497igb.0!news-out.google.com!a8ni16065qaq.1!nntp.google.com!w8no11498591qac.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.javascript Date: Tue, 24 Jun 2014 11:45:33 -0700 (PDT) In-Reply-To: <8c65ce0f-a999-4b0a-b571-ced9631f0c37@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=170.202.22.1; posting-account=soEzFAoAAAA9UnLg4OfAIq1tieDGxldE NNTP-Posting-Host: 170.202.22.1 References: <8c65ce0f-a999-4b0a-b571-ced9631f0c37@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <76ea0a63-d652-41ff-a50c-e2fa064e7d48@googlegroups.com> Subject: Re: Bijective basechanger From: Scott Sauyet Injection-Date: Tue, 24 Jun 2014 18:45:33 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.javascript:25008 jonas.thornvall@gmail.com wrote: > skrev Scott Sauyet: >> jonas.thornvall@gmail.com wrote: >> Is this the sort of thing you're looking for? >> >> var zeroless = function(str) { >> // [... function body elided ... ] >> }; >> [ ... ] >> zeroless("1091020134") //=> "A8AA1A134" > > Your Javascript function calling technic is far for advanced for > me i thought you called the functions with str as argument and > the result was stored in zeroless? No that is a function definition. I defined the function named `zeroless`. In this case it's much the equivalent of function zeroless(str) { // ... } although there are some significant differences between the techniques. > How can i run it? var result = zeroless("902310"); // then do what you want wtih `result`, including `console.log`ging // it, `document.write`ing it, or whatever else. Best of luck, -- Scott