Skip to content

Instantly share code, notes, and snippets.

class MyCollector : FlowCollector<Int> {
override suspend fun emit(value: Int) {
print(value)
}
}
class MyFlow : Flow<Int> {
@InternalCoroutinesApi
override suspend fun collect(collector: FlowCollector<Int>) {
for (i in 1..10) {
@vbevans94
vbevans94 / RC4
Created December 30, 2013 14:26
It's RC4 stream cipher implementation which outputs the same format results as in the article http://en.wikipedia.org/wiki/RC4#Test_vectors
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
public class RC4 {
private int[] S = new int[256];
private final int keylen;