[Question]
  [
Inspired by [a recent Daily WTF article](https://thedailywtf.com/articles/ternt-up-guid)...
Write a program or function that takes a GUID (string in the format `XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX`, where each X represents a hexadecimal digit), and outputs the GUID incremented by one.
## Examples
```
>>> increment_guid('7f128bd4-b0ba-4597-8f35-3a2f2756dfbb')
'7f128bd4-b0ba-4597-8f35-3a2f2756dfbc'
>>> increment_guid('06b86883-f3e7-4f9d-87c5-a047e89a19fa')
'06b86883-f3e7-4f9d-87c5-a047e89a19fb'
>>> increment_guid('89f25f2f-2f7b-4aa6-b9d7-46a98e3cb2cf')
'89f25f2f-2f7b-4aa6-b9d7-46a98e3cb2d0'
>>> increment_guid('89f25f2f-2f7b-4aa6-b9d7-46a98e3cb29f')
'89f25f2f-2f7b-4aa6-b9d7-46a98e3cb2a0'
>>> increment_guid('8e0f9835-4086-406b-b7a4-532da46963ff')
'8e0f9835-4086-406b-b7a4-532da4696400'
>>> increment_guid('7f128bd4-b0ba-4597-ffff-ffffffffffff')
'7f128bd4-b0ba-4598-0000-000000000000'
```
## Notes
* Unlike in the linked article, incrementing a GUID that ends in F must “carry” to the previous hex digit. See examples above.
* You may assume that the input will not be `ffffffff-ffff-ffff-ffff-ffffffffffff`.
* For hex digits above 9, you may use either upper (A-F) or lower (a-f) case.
* Yes, GUIDs may start with a `0`.
* Your output must consist of *exactly* 32 hex digits and 4 hyphens in the expected format, including any necessary leading `0`s.
* You do not have to preserve the version number or other fixed bits of the GUID. Assume it's just a 128-bit integer where none of the bits have any special meaning. Similarly, GUIDs are assumed to sort in straightforward lexicographical order rather than in the binary order of a Windows `GUID` struct.
* If writing a function, the input may be of any sequence-of-`char` data type: `string`, `char[]`, `List<char>`, etc.
  
[Answer]
# [Python 2](https://docs.python.org/2/), 50
* 3 bytes saved thanks to @Dennis.
```
lambda s:UUID(int=UUID(s).int+1)
from uuid import*
```
[Try it online!](https://tio.run/##K6gsycjPM/qfpmCrEPM/JzE3KSVRodgqNNTTRSMzr8QWzCjW1AOytQ01udKK8nMVSkszUxQycwvyi0q0/hcUAaUU0jSUzNMMjSySUkx0kwySEnVNTC3NdS3SjE11jRON0ozMTc1S0pKSlDT/AwA "Python 2 – Try It Online")
[Answer]
# JavaScript (ES6), 85 bytes
The output string is in lowercase.
```
s=>(g=(c,x=+('0x'+s[--n])+!!c)=>1/x?g(x>>4)+(x&15).toString(16):~n?g(c)+'-':'')(n=36)
```
[Try it online!](https://tio.run/##bYvBCoJAFADv/UWX9j22Z5q6WbAGQf5Ax@igqyuG7EZK7KlfNyk8FM1hLsNc80feqXtz68nYshq0HDqZQi1BLZ3kwHzHeHcmMhfk87lCmQYrt6/BpWmEHNwiiNHr7am/N6aGQODuacaskDNiO8YQjAwFDsqazraV19oaNLCk8vU2CWOK/ESMEgUVmzyiOFyXeSS2ItSaIc5@t6OffW0Hykbemvi36Q/0RxPjNrwA "JavaScript (Node.js) – Try It Online")
### Commented
```
s => (                   // s = GUID
  g = (                  // g = recursive function taking:
    c,                   //   c = carry from the previous iteration
    x = +('0x' + s[--n]) //   x = decimal conversion of the current digit
        + !!c            //       add the carry
  ) =>                   //
    1 / x ?              // if x is numeric:
      g(x >> 4) +        //   do a recursive call, using the new carry
      (x & 15)           //   and append the next digit
      .toString(16)      //   converted back to hexadecimal 
    :                    // else:
      ~n ?               //   if n is not equal to -1:
        g(c)             //     do a recursive call, leaving the current carry unchanged
        + '-'            //     and append a hyphen
      :                  //   else:
        ''               //     stop recursion
)(n = 36)                // initial call to g with n = 36 and a truthy carry
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~17~~ ~~15~~ 18 bytes
Saved 2 bytes thanks to *Kevin Cruijssen*
```
'-K1ìH>h¦Ž¦˜S·£'-ý
```
[Try it online!](https://tio.run/##yy9OTMpM/f9fXdfb8PAaD7uMQ8uO7j207PSc4EPbDy1W1z289/9/A1eDNEsLY1NdEwMLMyBhlqSbZJ5oomtqbJSSaGJmaWaclgYA "05AB1E – Try It Online")
or as a [Test Suite](https://tio.run/##jY09CsJAEEb7vUgaBzaz/42dIFh6gplsBq0sBEHwKHZCKnurNBusPNQaBDsLX/G6732HI/G@r5fTuTawaaf7erkrw3Msw@u6LY9ya2Aa66IGaTFytsCaCaxLAaIYB4ZQMDifhVnFJOgEBVACgyXywCkHsJ5S7E3H2ImKKy0pzlOro5/lGTiQBWcwk/XJGxH1405mPvqi9B@lNw)
**Explanation**
```
'-K                  # remove "-" from input
   1ì                # prepend a 1 (to preserve leading 0s)
     H               # convert from hex to base 10
      >              # increment
       h             # convert to hex from base 10
        ¦            # remove the extra 1
         Ž¦˜S·       # push [8, 4, 4, 4, 12]
              £      # split into parts of these sizes
               '-ý   # join on "-"
```
[Answer]
# [Python 2](https://docs.python.org/2/), 82 bytes
```
q='f0123456789abcdef--'
f=lambda s:[str,f][s[-1]in'f-'](s[:-1])+q[q.find(s[-1])+1]
```
[Try it online!](https://tio.run/##jY3LasNADEX3/orsxiZVGWvegXyJ8ULyWNTQunHsTb/edZumNBBIz@KC0NXR6WN5eR9xXaejEl2jsc6HmIi73AuAKuT4Sm@caTcfmnk5P0nbzA3U7TAqAdWWc3PYpmo/NdOzDGMuv7fVvm7X03kYl52UKkiNkbMF1kxgXQoQxTgwhILB@SzMqir@0@tUUfx6YxJ0ggIogcESeeCUA1hPKfamY@zky/u4l/WNt9eS4vbY6ui38AwcyIIzmMn65I1cvI96Vt949Q9wJ65s3j8HcgHuxBVVrZ8 "Python 2 – Try It Online")
No imports or hex conversion.
This scans from the back of the string, moving each character along the cycle `0123456789abcdef`, with `-` going to itself. After it hits a symbol other than `f` or `-`, it stops scanning leftwards, and just returns the remainder unchanged. This solution isn't specific to the UUID format -- any number of blocks of any number of hex letters would work.
The base case of `[str,f][s[-1]in'f-'](s[:-1])` is a trick I haven't seen used in a golf before. It terminates the recursion without any `if`, `and`, `or`, or other explicit control flow. 
Based on the condition `[s[-1]in'f-']` of the last character, the code either returns `f(s[:-1])` or just `s[:-1]` unchanged. Since `str` is the identity on strings, we can select one of the functions `[str,f]` and apply it to `s[:-1]`. Note that the recursive call with `f` is not made if it is not chosen, getting around the common issue problem that Python eagerly evaluates unused options, leading to infinite regress in recursions.
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 46 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
Anonymous tacit prefix function.
```
⎕CY'dfns'
(∊1hex 16(|+1⌽=)⍣≡1+@32dec¨)@('-'≠⊢)
```
[Try it online!](https://tio.run/##jY@9SgNBFIX7PMV0syEM7M7Ozs4WQiCNqQRjY3lnZq8RQiLZxoCFIASzmKCIpeBPY@cT2ORR7ousw4Z0QjzFgQsf3@XA1UT4BUxmF01Dm5fBOfc4rXgnovs6GZfXLNHRTS@hh5@jLq0/afWe9Pqp9KXbfnX7ERecVm9Uf3QbpOUjrTdBMjyh@m77ndLyKVyj00Hos@PhqEHGc0yksV4JG1sQKityYTDNRAoSZZ5pj9ZyRutX9g/SdYLRFCgzlCgk5lYoAC1s4XOhNBSmTJ2VDnfGw6SPW2MZY2HCKxUbHUpbYXNQIgu7QelCp7g3HiJV3Br/2IIhbe2zMzqYzxeMg5vPqoozD9WY0e0zG8HUjS@rsvoF "APL (Dyalog Unicode) – Try It Online")
`⎕CY'dfns'` **c**op**y** [the "dfns" library](http://dfns.dyalog.com/n_contents.htm) (to get [`hex` and `dec`](http://dfns.dyalog.com/n_hex.htm "Dyalog APL - Hexadecimal from decimal."))
`(`…`)`  
 `⊢` the argument  
 `≠` differs from  
 `'-'` a dash  
`(`…`)@` on the subset consisting of the locations **at** which the above criterion is true, apply:  
 `[dec](http://dfns.dyalog.com/c_dec.htm "Dyalog APL - Decimal from hexadecimal.")¨` convert each hexadecimal character to a decimal number  
 …`@32` **at** position 32 (the last digit), apply:  
  `1+` increment  
 `16(`…`)⍣≡` repeatedly apply with left argument 16 until stable:  
  `=` compare (gives mask where the hexadecimal digits are 16)  
  `1⌽` cyclically rotate one step left (this is the carry bit)  
  `|+` to that, add the division remainder when divided (by sixteen, thus making all 16 into 0)  
 `1[hex](http://dfns.dyalog.com/c_hex.htm "Dyalog APL - Hexadecimal from decimal.")`  turn digits into length-one hexadecimal character representations  
 `∊` **ϵ**nlist (flatten)
[Answer]
# Java 11, ~~152~~ ~~149~~ ~~111~~ 108 bytes
```
s->{var b=s.getLeastSignificantBits()+1;return new java.util.UUID(s.getMostSignificantBits()+(b==0?1:0),b);}
```
-38 bytes thank to *@OlivierGrégoire*.  
-3 bytes thanks to *@ASCII-only*.
[Try it online.](https://tio.run/##rVDLasMwELznK0RONq2MI8uvGrdQeik0uYScSg8rWwpKHTlYckoJ/nZXeV2CL607hwGtdmdmdwN7wJvysy8q0BrNQarDBCGpDG8EFBwtjk@ENrbPa42svNXq9QUVzk1Bu5nt6yaWtAEjC7RACuW9xo@HPTSI5dpbc/PGQZulXCspZAHKPEujHfduljXctI1Cin/dWDmnuXk9NOawPPefZg@@e8/crOuzo/2uZZW1v6TY17JEW7uVszSNVOv3DwTueaXltzZ869Wt8Xb2y1TKUd7tYp5o6u151JnGYkYSVlLMfAaYhmmMExGEOAAiSBxGpWBs6rqnU/xFP0kFCQURmIiYYQoQYZaWMaYRpAkPCkYKMUqf@yJNbGDqJ5GliGEWA8VhQEqgURoFYpT@wH2ExYmuGJX/ooEH6D/0/QvwAF0xRp//In836fof)
**Explanation:**
```
s->{         // Method with UUID as both parameter and return-type
  var b=s.getLeastSignificantBits()
             //  Get the 64 least significant bits of the input-UUID's 128 bits as long
        +1;  //  And increase it by 1
  return new java.util.UUID(
             //  Return a new UUID with:
    s.getMostSignificantBits()
             //   The 64 most significant bits of the input-UUID's 128 bits as long
    +(b==0?  //    And if the 64 least significant bits + 1 are exactly 0:
       1     //     Increase the 64 most significant bits by 1 as well
      :      //    Else:
       0,    //     Don't change the 64 most significant bits by adding 0
     b);}    //   And the 64 least significant bits + 1
```
---
**Old 149 bytes answer:**
```
s->{var t=new java.math.BigInteger(s.replace("-",""),16);return(t.add(t.ONE).toString(16)).replaceAll("(.{4})".repeat(5)+"(.*)","$1$2-$3-$4-$5-$6");}
```
[Try it online.](https://tio.run/##hZAxT8MwEIX3/grLymADZ7WO4ySqigQSAwNlYEQM58QuKWlaJW4RqvLbi1vCgop6w5N9tr97z0vcISzLj0NRY9eRJ6ya/YiQqvG2dVhYMj9uCXnxbdUsSMGGRcenod@PgnQefVWQOWnI7NDB7X6HLfGzxn6SZaCLFfp3cV8tHgNzYVvWidZu6sBmFOgNpfxmovm0tX7bNswLLMugz/MHLvz6ZxoLF/jvq7u6ZpSJveo5PfYsepbw69C64gEXTSIJUQyRgiiBSFM@7Q/To8/N1tTB52B3t65Ksgpxh0SvbwT5kPWr83Yl1lsvNuHI1w1rRMFo6iYyM6UCMzYIKslTyFycQIzSyTTRpTOG8tPH/A/JcicTJx1IlxpQiBpMXqagNOaZjQsjC3cZYscuz8JoNc50EG3ApKggiWWJSuc6dpchZ@K4UCf5rctOhotwRv5A@lF/@AY)
**Explanation:**
```
s->{                              // Method with String as both parameter and return-type
  var t=new java.math.BigInteger( //  Create a BigInteger
         s.replace("-",""),       //  Of the input-string with all "-" removed
         16);                     //  Converted from Hexadecimal
  return(t.add(t.ONE)             //  Add 1
         .toString(16))           //  And convert it back to a Hexadecimal String
         .replaceAll("(.{4})".repeat(5)+"(.*)",
                                  //  And split the string into parts of sizes 4,4,4,4,4,rest
           "$1$2-$3-$4-$5-$6");}  //  And insert "-" after parts of size 8,4,4,4,
                                  //  and return it as result
```
[Answer]
# [Ruby](https://www.ruby-lang.org/) `-pl`, ~~62~~ ~~57~~ 55 bytes
```
$_="%032x"%-~gsub(?-,"").hex
7.step(22,5){|i|$_[i]+=?-}
```
[Try it online!](https://tio.run/##bY7LSgNBEEX3/RlDAgmmQqf6Vb0I@RCRUDXdFQfEDE4CEaOfbjsI7jyLs7oc7ttV3ltbHPfd0jq8dUv4Ok1XWR1g03Xr7XO9mbSdLnVcIW7C@uM@3BfHx@HpYX@Az9aS7pCkeBArDD7kBKQugGNUTCEWFTE2CkUiB@pqAq@5AKU@AFufKmXeZWVDWTEoKqAmAc8cQXKZ55EzVdcL9mqoWs00972lOCsKSGIPwWFhH3N0quafTzrzqz@@z@NlOL9ODcaXHw "Ruby – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 50 bytes
```
from uuid import*
lambda u:UUID(int=UUID(u).int+1)
```
[Try it online!](https://tio.run/##K6gsycjPM/7/P60oP1ehtDQzRSEztyC/qESLKycxNyklUaHUKjTU00UjM6/EFswo1dQDsrUNNf@nKdgqEFLEVVAEZGikaaibpxkaWSSlmOgmGSQl6pqYWprrWqQZm@oaJxqlGZmbmqWkJSWra2r@BwA "Python 3 – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), ~~113~~ 112 bytes
```
def f(s):a=hex(int(s.replace('-',''),16)+1+2**128);return'-'.join((a[3:11],a[11:15],a[15:19],a[19:23],a[23:-1]))
```
[Try it online!](https://tio.run/##jY3NagJBEITvPkVuM6PbMv9/IU8iHmZ2p1EJ67JuIHn6zagxRBBMHYqCrv5q@Jp2x17Oc1fwBemJxfS2K59030/0tB7L8J7aQgmQhhDWCMtWYiWXSyE9ex3L9DH29bY@HPc9pWmjohDbJm2EiMJcgokiXEKIUp2DVBHElrF5GOtGnSQOKy13GjLPCbQJDjwqAypJlM7YDnMmbPGfXksWi1@uDygNSgSJLoNOyUIOnQNtU/BFtVm2eOY@73X8jls4Bl@HNfe2ms2QXdJglOyStsEqvHKf9TS/4/IfwQO7qXL/POBV8MBuImz@Bg "Python 2 – Try It Online")
Without imports
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 21 bytes
```
T`FfdlL`0dlL`.[-Ff]*$
```
[Try it online!](https://tio.run/##bc2xCgIxEITh/p5DQYSVuNkkmxc4G0s7EW7X3IAgFuL7x1Ow8y@@bpjn/Lo9rK83h6mfphHtfpzCh92ZRly2q94L9qzehDy4kaRaSBETRWNwSbnBfdAKTmAQoziJWSavrZBkqzrHq/MVg84BVZepBM0L2cmLCaXIzSTXHIHhzx2Wvvx6Aw "Retina 0.8.2 – Try It Online") Link includes test cases. `9` becomes `a`. Explanation: The regex matches all trailing `f`s and `-`s plus one preceding character. The transliteration then cyclically increments those characters as if they were hex digits. Alternate approach, also 21 bytes:
```
T`L`l
T`fo`dl`.[-f]*$
```
[Try it online!](https://tio.run/##bY2xCgIxEAX7fIeCCCvnJtkkX2BjeZ0I2b3cA@E4Qfz/eAh2TjHdMK/5/Vi17w@X2sd6rYsbK561LfV0I9yPu94TzpytBbLBlEIsiTJ8JK8MTlEazFwu4AgGMZJRUBWy0hIF0ZJnPxlPcHkeUPKWhiHLJjGypIGi56ZBinjA/dlh46sfHw "Retina 0.8.2 – Try It Online") Link includes test cases. Works by lowercasing the input to simplify the transliteration. Would therefore be 15 bytes if it only had to support lowercase. [Try it online!](https://tio.run/##bY1BCkIxDAX3/xwKIkRqmrbpCbyAOxGa/P4HgiiI968fwZ2zmN0wr@V9e9jY7k5tnBuerd/b4UK47jdjFBxZvQt5cCNJtZAiJorG4JJyh/ukFZzAIEZxErNMXnshyVZ1ibPzjEmXgKprKkHzquzkxYRS5G6Sa47A9GeHla9@fAA "Retina 0.8.2 – Try It Online") Link includes test cases.
[Answer]
# MATLAB, 138 bytes
```
a=1;Z=a;for r=flip(split(input(''),'-'))'
q=r{:};z=dec2hex(hex2dec(q)+a,nnz(q));try
z+q;a=0;catch
z=~q+48;end
Z=[z 45 Z];end;disp(Z(1:36))
```
Fixed a bug in case a chunk is all zeros. Also golfed off a lot by abusing try/catch. Net result: 0 bytes saved.
An attempt to 'cheat' by using `java.util.UUID` failed because the `long` value returned from `java.util.UUID.get[Most/Least]SignificantBits` gets converted to a `double` which incurs a loss of precision. I invite you to take a look at [this table](https://nl.mathworks.com/help/matlab/matlab_external/handling-data-returned-from-java-methods.html#bvizhgf) and silently utter "...but *why?*"
### Explanation
The `hex2dec` function spits out a `double`, so it cannot process the entire GUID at once to avoid exceeding `flintmax`. Instead, we have to process the GUID chunk by chunck, using `split`. The variable `a` checks if we need to carry a one, and cheatingly also is the initial increment we add. The condition for carrying over is whether the lengths of the original and incremented strings are no longer equal.
Original version was just under 160 bytes so I'd like to think this should not be easy to outgolf.
[Answer]
# [Python 2](https://docs.python.org/2/), 99 bytes
```
s='%032x'%-~int(input().replace('-',''),16)
print'-'.join((s[:8],s[8:12],s[12:16],s[16:20],s[20:]))
```
[Try it online!](https://tio.run/##NYpBCsMgFET3vUf4Chr0NzVWyElCFrFNqKUYiRaaTa9uTaBvMfMYJmzpsXjMOXZQiTN@oOJf5xNxPrwTofU6hdd4mwhwYACUSUVPYS2PMtTPxXlCYm/0wGKvjcS9JRqpDlEGxS4ozEBpztDOErW9N9wKO/Lmcm35XDjiD/wA "Python 2 – Try It Online")
No `uuid.UUID` usage.
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 77 bytes
```
x=>{for(int i=35,c;(x[i]=(char)((c=x[i--])<48?c:c==57?65:c>69?48:c+1))<49;);}
```
[Try it online!](https://tio.run/##bZC9bsIwFIX3PIXF5Ki4Ase/BINsgifGSh1QhsgKxUuQnKilQjx7akNbVKl3uPK597Otc1yPXO9H7QZ/6pbu2IR9vQIHoMazWl0OpwB9NwCvCjp1JTzvfa1gonIInYoSoTpfErF2C6cU5WtGF27F5JqIhXua53Eny7y8jmWW9UPw3du@BkPbDz1QoGs/wO/wkoEJt3MsTEWQmRmNCJUcCVtQVGhsMaesssZMphEU0mJqsUXYcoOI1gwZWXFEmJZiW2wM3tg7uJ1ZKeITZCZYbMwgwzVBtMCVJkyywt7Bf762sW7tpyJ4jT5iKG3jjgC@N@HmBfju7ilPLl6DH9qd71qYZnmZgcSlzJLnNHt@OW2i1CE0nzABh1ukfTo@bj/S@d7@XUd1Hb8A "C# (Visual C# Interactive Compiler) – Try It Online")
-1 byte thanks to @ASCIIOnly!
Anonymous function that takes a `char[]` as input and [outputs by modifying an argument](https://codegolf.meta.stackexchange.com/a/4942/8340).
Input is scanned from right to left and replaced using the following rules.
* The `-` character is ignored and processing continues
* The `F` character is converted to `0` and processing continues
* The `9` character is converted to `A` and processing stops
* The characters `A-E` and `0-8` are incremented by 1 and processing stops
[Answer]
# Powershell, 101 bytes
```
for($p=1;$d=+"$args"[--$i]){$d+=$p*(1-@{45=1;57=-7;70=23;102=55}.$d)
$p*=$d-in45,48
$r=[char]$d+$r}$r
```
[Try it online!](https://tio.run/##lZPdattAEIXv9RRCbGup0ZTVan9rBEkv8hIhlF3tTmIwjSsntOD62d2pGsVqMMSZi4Eze@ZjZmA3Dz/TsL1P6/WBYd7luwM@DCXbdM2Sxe6iYH642xY3AGx1W@1YvOjY5lPZwOVOKvIo04FZGt6Jdtlw0Sm1/8xilZGpYxFW36Wqpc3Y0N309364JQAb9mw47LPsssxyirpc4KJe8EU1yev/JSfZHKUjeXWUVyS/HqUnGWa98JfdwBwH169KhcFG2BAlBB48SOUMWGwVtF6gMEpHDKGoz7H1xQuU62C1tS1gmwxIdBGs6RV4Lk2yzjcOHUHPsPkj1DoUCgWCQBNAeq8huEh92jub2j6IHgn6ti3yGTRxdJYWkdxqSjpAMF6CakX0Ujvd4gh9yyb5DHriWEgxpilO3dQCpxjTFO9Z3523vp9Bp2ngRJpNOk0DJ9Js0ir/nX/IdyOc3T2tYs3Sr03qH1Ok78W@/XsY0vZp/UiFj/TrRttYL1j5/ATpx0tf9WVqKLL94Q8 "PowerShell – Try It Online")
No external library or hex conversion. Any string length. Lower case and upper case are allowed. Input string matching to `^[f-]*$` is allowed too.
This script scans from the back of the string and inrement each char by the value from hashtable:
* `-`: increment=1-1
* `9`: increment=1+7, result=`A`
* `F`: increment=1-23, result=`0`
* `f`: increment=1-55, result=`0`
* increment=1 for other chars
Next, the script uses `$p` to determine whether to increment the current char.
Test script:
```
$f = {
for($p=1;$d=+"$args"[--$i]){$d+=$p*(1-@{45=1;57=-7;70=23;102=55}.$d)
$p*=$d-in45,48
$r=[char]$d+$r}$r
}
@(
    ,('f','0')
    ,('F','0')
    ,('0','1')
    ,('9','A')
    ,('A','B')
    ,('a','b')
    ,('0-f','1-0')
    ,('0-F','1-0')
    ,("7f128bd4-b0ba-4597-8f35-3a2f2756dfbb","7f128bd4-b0ba-4597-8f35-3a2f2756dfbc")
    ,("06b86883-f3e7-4f9d-87c5-a047e89a19f9","06b86883-f3e7-4f9d-87c5-a047e89a19fa")
    ,("89f25f2f-2f7b-4aa6-b9d7-46a98e3cb2cf","89f25f2f-2f7b-4aa6-b9d7-46a98e3cb2d0")
    ,("8e0f9835-4086-406b-b7a4-532da46963ff","8e0f9835-4086-406b-b7a4-532da4696400")
    ,("7f128bd4-b0ba-4597-ffff-ffffffffffff","7f128bd4-b0ba-4598-0000-000000000000")
    ,("89f25f2f-2f7b-4aa6-b9d7-46a98e3cb29f","89f25f2f-2f7b-4aa6-b9d7-46a98e3cb2a0")
    ,("ffffffff-ffff-ffff-ffff-ffffffffffff","00000000-0000-0000-0000-000000000000")
) | % {
    $guid,$expected = $_
    $result = &$f $guid
    "$($result-eq$expected): $result"
}
```
Output:
```
True: 0
True: 0
True: 1
True: A
True: B
True: b
True: 1-0
True: 1-0
True: 7f128bd4-b0ba-4597-8f35-3a2f2756dfbc
True: 06b86883-f3e7-4f9d-87c5-a047e89a19fA
True: 89f25f2f-2f7b-4aa6-b9d7-46a98e3cb2d0
True: 8e0f9835-4086-406b-b7a4-532da4696400
True: 7f128bd4-b0ba-4598-0000-000000000000
True: 89f25f2f-2f7b-4aa6-b9d7-46a98e3cb2A0
True: 00000000-0000-0000-0000-000000000000
```
[Answer]
# [Perl 6](https://perl6.org), 65 bytes
```
{(:16(TR/-//)+1).base(16).comb.rotor(8,4,4,4,*)».join.join('-')}
```
[Test it](https://tio.run/##jY/fSsMwFMbv8xSHMWyyLW3Xpmk7tfgM6qUgSZpoZf1Dm4oy9mTe@WKz7RQVFCVwyDnn4/t9p9Htlh/6TsMjd9UpQuUznBSVanWpK0vv@iKH88MOb9YcX1961PPIck1cKTqN15y4qi6l29a2bnGyYtNbkNcX96EuqqlghzpkfxhsL6zuLJzDtqh055ai2QDNYF5UK5jXvYUdAsBjO3ajRymsusfgwY0DZxjcBZBs/Hswbq9si/ZoTH49@J6iZisqWE6Q4QxTt@/AgYFHStPbAaSfGq2szoFMvKKD78fio5J8kbq9WsHsOJ8SfyxmaH/IsuzT4XZycGKzDhKZMyp9KSiL0pgmJoxoKAITxBHPjZQOQf/RKQf9REhSE0QmMDQwsaRMCE5lmseUcZEmOlQyUGYk/K3L/V8I2jdpMoRhfsKHwiWVsWA0CoNcMJ7y0BwJf@mY7ztv "Perl 6 – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 20 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-2 (and a bug fix) thanks to Dennis!
```
ØhiⱮṣ0µẎḅ⁴‘ḃ⁴ịØhṁj”-
```
**[Try it online!](https://tio.run/##y0rNyan8///wjIzMRxvXPdy52ODQ1oe7@h7uaH3UuOVRw4yHO5qBjIe7u4EqHu5szHrUMFf3////5mmGRhZJKSa6SQZJibomppbmuhZpxqa6xolGaUbmpmYpaUlJAA "Jelly – Try It Online")**
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 126 bytes
```
$a=("{0:X32}" -f (1+[Numerics.BigInteger]::Parse($args[0]-replace"-", 'AllowHexSpecifier')));5..2|%{$a=$a.Insert(4*$_,"-")};$a
```
[Try it online!](https://tio.run/##jZHBa8IwGMXv@StCqbPdTKlJmiaKsO00L2Owy0BEkvb7XKFTSR0Oav921zn0tMPe4Z1@j/fg7bYH8M071PUpxA2d0fYU2lkUtOnkTfAuoAxpNL5bPH9@gK@KJnms1vPNHtbgl5PJi/UNRKH162aRLpmHXW0LCFgwosOHut4enuDrdQdFhRX4YRzH0yxJ@HHQ9h2hTeabBvw@krfhatSH4m4a2lNHCLmPCO0V5Djm2pWSudRZJjOTM40iY8Jy5HmmSnQuGP2yqXJaaS0YCsiZRFMynRcZs6nMQRs7NmgvrDbIM@TIOOaOSWsVc6bsU8oaDaJwvMArCyka3ZfKVKvelGMut5JlgpdWKqMEXtk/9mKvs130/w0GAxLTIx3QlpwzNz8XhStCOnL6Bg "PowerShell – Try It Online")
Pretty trivial answer. Just thought I'd get the beloved PowerShell added to the list :)
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 78 bytes
```
s=>s.replace(/.([f-]*)$/,(s,y)=>('0x'+s[0]-~0).toString(16)+y.replace(/f/g,0))
```
[Try it online!](https://tio.run/##bZCxTsMwGIT3PEUGpNg0v@s6juMIJRtPwFgq1Xb8p0UhqWIL0YVXLwYJWLjhttPddy/mzQS3ni8R5mXwN@xuoesDW/1lMs6TLSN7hMM9vduWJJRX2vWk4O/FJuz5AT44ZXF5iut5HslO0c31L4jbseSU3twyh5hHH6IzwYe8y49Zgzuh7SDBcmtA1m0DGqsaKiNQNLUa0NpMtyhqFAgCGwvSGAW2HRqQyrTaV84Kh5n2HFudopJrlUxZsI2RUFdiMFK1qkL8rw6Tvu1H2ZEljFdCWbhM50iK57mgD9nvbobL@mjciSSCPv@CWibPpmVMr@RF1xdljiTQBPwJ "JavaScript (Node.js) – Try It Online")
[Answer]
# Perl 5, 64 bytes
```
$c=reverse((1+hex s/-//gr)->as_hex);$c=~s/..$//;s/[^-]/chop$c/ge
```
The number of parentheses necessary here makes me sad, but `->` binds very tightly, as `->as_hex` is the quickest way I can find to get hexadecimal-formatted output.
Run with `perl -Mbigint -p`. Basically, it just converts the number to a bigint hexadecimal, adds one, and then subtitutes the digits of the result back into the original value, leaving dashes untouched.
[Answer]
# Rust, 258 bytes
```
let x=|s:&str|s.chars().rev().scan(1,|a,c|{let d=c.to_digit(16).unwrap_or(99);match(d,*a){(15,1)=>{*a=1;Some(0)}(0..=14,1)=>{*a = 0;Some(d + 1)}_=> Some(d),}}).collect::<Vec<u32>>().iter().rev().for_each(|d| print!("{}", std::char::from_digit(*d, 16).unwrap_or('-')));
```
yes its long.. but technically its only one line with 1 expression? and no fancy libraries? and it will not crash on a fuzz input? ungolf:
```
let x=|s:&str|s.chars().rev().scan(1, |a, c| {
            let d = c.to_digit(16).unwrap_or(99);
            match (d, *a) {
                (15, 1) => {*a = 1;Some(0)}
                (0..=14, 1) => {*a = 0;Some(d + 1)}
                _ => Some(d),
            }
        }).collect::<Vec<u32>>().iter().rev()
        .for_each(|d| print!("{}", std::char::from_digit(*d, 16).unwrap_or('-')));
```
[try it on rust playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018)
[Answer]
## 16/32/64-bit x86 assembly code, 28 bytes
bytes: 83C623FDAC3C2D74FB403C3A7502B0613C677502B03088460173E9C3
code:
```
     add esi, 35       ;point to end of string - 1
     std               ;go backwards
l1:  lodsb             ;fetch a character
     cmp al, '-'
     je  l1            ;skip '-'
     inc eax           ;otherwise increment
     cmp al, '9' + 1
     jne l2            ;branch if not out of numbers
     mov al, 'a'       ;otherwise switch '9'+1 to 'a'
l2:  cmp al, 'f' + 1   ;sets carry if less
     jne l3            ;branch if not out of letters
     mov al, '0'       ;otherwise switch 'f'+1 to '0'
                       ;and carry is clear
l3:  mov [esi + 1], al ;replace character
     jnb l1            ;and loop while carry is clear
     ret
```
Call with ESI pointing to GUID. Replace ESI with SI for 16-bit, or RSI for 64-bit (and +2 bytes).
[Answer]
# [C (clang)](http://clang.llvm.org/), 62 bytes
```
g(char*i){for(i+=36;(*--i-45?*i+=*i-70?*i-57?1:8:-22:0)<49;);}
```
[Try it online!](https://tio.run/##fY7BbsIwEETv@xVWEJKd4CpATEI2Lrf@BHCwAgkrgUEmPkX59tQUeqhUMYfRrt5oNLWsz8a249jy@mRcTKJvro5Topcr5LGUJDO1icMfk8zTcEmVb@ZlUcrFokxFla1R4DBOyNZnfzhW9@5A14/TJ5Dt2MWQ5YL18OhmZrvXfbT@ekr@Yy@l0YAAPztCiWc6K9BX@Rx9kogeqOFea1UIr1cKwWyXaq89ws2FeMOj6Z3tbDQzAqHlD/8DftEA8A4DsCB37LyzLA3x8Rs "C (clang) – Try It Online")
[Answer]
# Common Lisp, 166 bytes
```
(lambda(s &aux(r(format()"~32,'0x"(1+(parse-integer(remove #\- s):radix 16)))))(format()"~{~a~^-~}"(mapcar(lambda(x y)(subseq r x y))#1='(0 8 12 16 20 32)(cdr #1#))))
```
[Try it online!](https://tio.run/##bU/bSsQwEP2VIYtuig60SZqLsH6JCJMmkcJ2W9NdqYj99TUVBR88DwcGzmVOd@zn6cqP4zhBGjP00J9gz5lJjbA@KPS1J1StM2iTbFGSSMK0OiTvGbBae6utlZhkNKiSC2hN1yLVykTrqHGJisy6JNokEopkPCoijd6FYtDkbJSdF13aZLFOzpYWVVtdSHv0hhS2UgRS2mmZNtk/v6WCb/oFqyCMwMukgc5wBrYSwOERVlpvWFnJy2YafCA@wy1dFp5/tLxiqxT3@3phvLnjE@U5Yn86x5eYeY7D@BZh94QwVw@ZQr9Ao6sNf@wfpeQZ10/GB5o6yr9NC7xXfL74Ob5Chu2qds1hz2uw0IgSBKIGKSrehQy7ZrfFXvuNvgA)
]