Hacker Newsnew | past | comments | ask | show | jobs | submit | dteoh's commentslogin

You can store the expiry time in the token itself. Then it is up to your server to validate that the token is still live. If you need to mass invalidate every token, you change the signing key.


So is there any way to do single-sign-out if using these tokens for authentication?


> shuffling a deck of cards in O(1)

How? I'm aware of Knuth shuffle which is O(n) but I can't find anything about constant time shuffling.


You use the algebraic property that xy mod n will generate a shuffle of Zn if y and n are relatively prime (don't share any divisors). So if you then redefine "element a" to not refer to the index of the original array, but to ay mod n, and you've got your shuffle. You pick y randomly, and in order to make y and n relatively prime, you simply change n to be a prime number.

None of this requires you to actually go through the list. You'd have to modify this to support lists of non-prime lengths, but this is the basic idea :

  import random
  lst = [1,2,3,4,5]

  class newlist:
      def __init__(self, lst):
          self.lst = lst # assuming lst has a prime length.
          self.y = 0
          while self.y % len(lst) == 0:
              self.y = random.randint(1, 999999)

      def __getitem__(self, index):
          nidx = (index * self.y) % len(lst)
          return self.lst[nidx]
      
  # Start shuffling
  nl = newlist(lst)
  # End shuffling ... algorithm done.

  for i in range(len(lst)):
          print i, nl[i]


> On top of that, what other per-file cross platform encryption options are there?

Boxcryptor is an option, but it is not open source.


Boxcryptor 2 doesn't have a Linux client and Boxcryptor Classic was just mostly EncFS so its Linux support was the same as Safe here.


I think the more grammatically correct question sentences would be "kami wa doko desu ka" (as for kami, where is it?) or "doko ga kami ga (ar)imasu ka" (where does kami exist?).

> Which kami I was thinking about is for me to know and you to guess incorrectly.

Well, if you used the kanji then we wouldn't have to guess ;)


> Well, if you used the kanji then we wouldn't have to guess ;)

It was a trick: kami was used as a portmanteau of KAeru (frog) and MIso, so in this case, kami = frog-flavored miso soup :P


Less computation power required to store new data.


PG didn't write this article, Olin Shivers did.


And Jonathan had some small amendments:

http://mumble.net/~jar/tproject/


I use Dropbox with Boxcryptor (https://www.boxcryptor.com/). It creates an encrypted drive/folder using a key of your own choosing.


I set up Gmail on iOS as an Exchange account and server side searching works for me.


The Apache Harmony project has been discontinued.


Oh, you're right! I only wondered because of what I've been reading about the case, since it was mentioned a few times.

Though I guess the same question could be asked of GNU Classpath, which as far as I can see is still actively maintained.


I wonder if they have plans to turn this into a universal app or if we will have to purchase another version for the iPad (not that I'm complaining about paying for a valuable product).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: