Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
#r "mscorlib.dll" | |
#r "System.dll" | |
open System | |
open System.Windows.Forms | |
type Update<'Msg, 'Model> = 'Msg -> 'Model -> 'Model | |
type Dispatch<'Msg> = 'Msg -> obj -> EventArgs -> unit | |
type View<'Model, 'Msg> = 'Model -> Dispatch<'Msg> -> Control |
open Microsoft.AspNetCore | |
open Microsoft.AspNetCore.Hosting | |
open Giraffe | |
WebHost | |
.CreateDefaultBuilder() | |
.UseKestrel() | |
.Configure(fun a -> a.UseGiraffe(route "/" >=> POST >=> bindJson json)) | |
.ConfigureServices(fun s -> s.AddGiraffe() |> ignore) | |
.Build() |
using System.Console; | |
def skip_loop(counter, skip, max, idx, lst) { | |
if (idx >= max) lst | |
else | |
if ( counter >= skip ) | |
skip_loop(1, skip, max, idx + 1, idx :: lst) | |
else | |
skip_loop(counter + 1, skip, max, idx + 1, lst) | |
} |
using System; | |
using System.Console; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
def skip_loop(counter, skip, max, idx, lst) { | |
if (idx > max) lst | |
else | |
if ( counter >= skip ) | |
skip_loop(1, skip, max, idx + 1, idx :: lst) |
/** | |
* Performs Murmur3_32 hashing. | |
* https://en.wikipedia.org/wiki/MurmurHash | |
* @param key Int32Array input key | |
* @param seed int32 input seed | |
* @returns int32 value | |
*/ | |
export default function murmur332(key, seed) { | |
let hash = seed; |
import murmur332 from './murmur332.js'; | |
// https://en.wikipedia.org/wiki/Bloom_filter | |
// https://hur.st/bloomfilter/ | |
export default class BloomFilter { | |
#data; | |
#dataBitMask; |
#r "nuget: FSharp.Data, 5.0.2" | |
open System | |
open System.Diagnostics | |
open FSharp.Data | |
open System.IO | |
let [<Literal>] feedUrl = "https://peapix.com/bing/feed" | |
type BingoImage = JsonProvider<feedUrl> | |
let out = Path.Combine(__SOURCE_DIRECTORY__, "bing") |
module ZenUtil | |
#r "nuget: NAudio" | |
#r "nuget: System.Speech" | |
open NAudio.Wave | |
open System | |
module WindowsSpeech = |