Skip to content

Instantly share code, notes, and snippets.

View SeverinAlexB's full-sized avatar

Severin Alexander Bühler SeverinAlexB

  • A80F C42B 75E8 771B 196D  EB41 BD10 406A 48C7 3F88
  • Switzerland
  • X @SeverinAlexB
View GitHub Profile
@SeverinAlexB
SeverinAlexB / scidConverter.ts
Last active April 2, 2024 11:06
Lightning Network short channel id (CLN) to decimal id (LND) converter
/** By LnRouter.app */
function bitShift(n: number, shiftBy: number): number {
let base = n;
for (let i = 0; i < shiftBy; i++) {
base = base * 2;
}
return base;
}
export function shortChannelIdToDecimalId(shortChannelId: string): string {
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en-CH"><head><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"><link href="/images/branding/product/ico/googleg_lodp.ico" rel="shortcut icon"><meta content="origin" id="mref" name="referrer"><title>Google</title> <script>(function(){window.google={kEI:'37roWfiCBMjZU6-wp9gD',kEXPI:'18168,201806,1352261,1352823,1353383,1353606,1354277,1354401,1354442,1354915,1355218,1355325,1355736,1355801,1355820,1356070,3700314,3700440,3700476,4029815,4031109,4038214,4038394,4040135,4041776,4043492,4045096,4045293,4045841,4047140,4047454,4048347,4048980,4050750,4051887,4056126,4056682,4058016,4061666,4061980,4062724,4063220,4064468,4064796,4069829,4072270,4072774,4076999,4078588,4080760,4081038,4081165,4082230,4092183,4093524,4095910,4097153,4097194,4097469,4097922,4097928,4098733,4098739,4098751,4102237,4103254,4103475,4103861,4104202,4104258,4104414,4105240,4106647,4109293,4109316,4109489,4110086,41106